// CSE 142 Winter 2008, Marty Stepp // // This program draws several rectangles using loops. // You must have DrawingPanel.java in the same folder as your program. import java.awt.*; public class DrawLoops { public static void main(String[] args) { DrawingPanel panel = new DrawingPanel(160, 160); Graphics g = panel.getGraphics(); // for (int i = 0; i < 10; i++) { // g.drawRect(20 + 10 * i, // x // 20 + 10 * i, // y // 100 - 10 * i, // w // 10); // height for (int i = 0; i < 10; i++) { g.drawRect(100 - 10 * i, // x 20 + 10 * i, // y 10 + 10 * i, // width 10); // height } } }